package com.shujia.transformation

import org.apache.flink.streaming.api.scala._

object Demo08Union {
  def main(args: Array[String]): Unit = {

    val env: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment
    // 通过socket构建无界流
    val socketDS1: DataStream[String] = env.socketTextStream("master", 8888)

    // 通过socket构建无界流
    val socketDS2: DataStream[String] = env.socketTextStream("master", 7777)

    socketDS1.union(socketDS2).print()

    env.execute()


  }

}
